package com.weblog.search.pojo;

import org.springframework.data.annotation.Id;
import org.springframework.data.elasticsearch.annotations.*;

import java.io.Serializable;
import java.util.Date;

/**
 * @author MaoLin Wang
 * @date 2019/9/2813:56
 */
@Document(indexName = "weblog_article",type = "article")
public class Article implements Serializable {

    private static final long serialVersionUID=-4678122356942943999L;

    @Id
    private String aid;

    @Field(type = FieldType.Keyword)
    private String categoryname;

    @Field(type = FieldType.Keyword)
    private String  clevel;

    @Field(type = FieldType.Keyword)
    private String cid1;

    /**
     * @MultiField 指定多个类型
     */
    @MultiField(mainField = @Field(type = FieldType.Keyword),
            otherFields = {@InnerField(type = FieldType.Text, analyzer = "ik_max_word", searchAnalyzer = "ik_max_word", suffix = "text")})
    public String cids;


    @Field(type = FieldType.Keyword)
    private String userid;

    @Field(type = FieldType.Text,analyzer = "ik_max_word",searchAnalyzer = "ik_max_word")
    private String title;

    @Field(type = FieldType.Text,analyzer = "ik_max_word",searchAnalyzer = "ik_max_word")
    private String contenthtml;



    @Field(type = FieldType.Date)
    private Date publishtime;

    @Field(type = FieldType.Date)
    private Date lastupdate;

    @Field(type =FieldType.Keyword)
    private String ispublic;

    @Field(type =FieldType.Keyword)
    private String ishot;

    @Field(type =FieldType.Keyword)
    private Long thumbup;

    @Field(type =FieldType.Keyword)
    private Integer commentnum;

    @Field(type =FieldType.Keyword)
    private String state;

    public String getClevel() {
        return clevel;
    }

    public void setClevel(String clevel) {
        this.clevel = clevel;
    }

    public String getCid1() {
        return cid1;
    }

    public void setCid1(String cid1) {
        this.cid1 = cid1;
    }

    public String getCids() {
        return cids;
    }

    public void setCids(String cids) {
        this.cids = cids;
    }

    public String getIshot() {
        return ishot;
    }

    public void setIshot(String ishot) {
        this.ishot = ishot;
    }

    public Long getThumbup() {
        return thumbup;
    }

    public void setThumbup(Long thumbup) {
        this.thumbup = thumbup;
    }

    public Integer getCommentnum() {
        return commentnum;
    }

    public void setCommentnum(Integer commentnum) {
        this.commentnum = commentnum;
    }

    public String getState() {
        return state;
    }

    public void setState(String state) {
        this.state = state;
    }

    public String getAid() {
        return aid;
    }

    public void setAid(String aid) {
        this.aid = aid;
    }

    public String getCategoryname() {
        return categoryname;
    }

    public void setCategoryname(String categoryname) {
        this.categoryname = categoryname;
    }

    public String getUserid() {
        return userid;
    }

    public void setUserid(String userid) {
        this.userid = userid;
    }

    public String getTitle() {
        return title;
    }

    public void setTitle(String title) {
        this.title = title;
    }

    public String getContenthtml() {
        return contenthtml;
    }

    public void setContenthtml(String contenthtml) {
        this.contenthtml = contenthtml;
    }

    public Date getPublishtime() {
        return publishtime;
    }

    public void setPublishtime(Date publishtime) {
        this.publishtime = publishtime;
    }

    public Date getLastupdate() {
        return lastupdate;
    }

    public void setLastupdate(Date lastupdate) {
        this.lastupdate = lastupdate;
    }

    public String getIspublic() {
        return ispublic;
    }

    public void setIspublic(String ispublic) {
        this.ispublic = ispublic;
    }
}
